package com.bjc.mp.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;


@RestController
@RequestMapping("api/wx")
@Api(value = "wxCp-api", tags = { "微信认证相关接口" })
@Slf4j
public class WxMpController {

	@Autowired
	private WxMpService wxMpService;
	
	@PostMapping("createJsapiSignature")
	public WxJsapiSignature createJsapiSignature(@RequestBody String url) throws WxErrorException {
		return wxMpService.createJsapiSignature(url);
	}
}
